<?php  
$filename= urlencode($_POST['FileName']);
$scriptname=$_POST['ScriptName'];
$uid= $_POST['Uid'];
$data=urldecode($_POST['Data']);
$scriptid=$_POST['ScriptID'];
echo $scriptid;
echo $filename;
$fp = fopen("./".$uid."/".$scriptid."/".$filename.".mhtml", "w"); 
file_put_contents("./".$uid."/".$scriptid."/".$filename.".mhtml", $data);
chmod("./".$uid."/".$scriptid."/".$filename.".mhtml", 0777) ;  
fclose($fp); 
/*system("mkdir ./".$uid."/".$scriptid."/".$filename);
chmod("./".$uid."/".$scriptid."/".$filename, 0777) ; 
system("./mhtmlconverter/libmhtml.py -p ./".$uid."/".$scriptid."/".$filename.".mht ./".$uid."/".$scriptid."/".$filename );
*/
?>